#ifndef GRID_H
#define GRID_H

#include <QPushButton>
#include <QMouseEvent>

#define mine_wide_height 32     //雷的长和宽

class Grid : public QPushButton
{
    Q_OBJECT
public:
    //explicit Grid(QWidget *parent = nullptr);
    Grid();

    //是否为雷
    bool isMine = false;
    //是否被点开
    bool isClicked = false;
    //是否被放旗子
    bool isFlag = false;
    //周围8个格子的雷数
    int num = 0;

    //坐标（行 列）
    int mine_row;
    int mine_col;

    //重写鼠标进入事件
    void enterEvent(QEnterEvent *event);
    //鼠标离开
    void leaveEvent(QEvent *event);
    //鼠标按下
    void mousePressEvent(QMouseEvent *e);

signals:
    //右键点击 放置旗子
    void playFlag();
};

#endif // GRID_H
